package blog.gui;

import javax.microedition.lcdui.Image;

public interface CameraViewer
{
	//idle state
	public static final int STATE_IDLE = 0;

	//photo processing states
	public static final int STATE_PHOTO_VIEWFINDER = 1;

	public static final int STATE_PHOTO_RECORDING = 2;

	public static final int STATE_PHOTO_CAPTURED = 4;

	//video processing states
	public static final int STATE_VIDEO_VIEWFINDER = 8;

	public static final int STATE_VIDEO_RECORDING = 16;

	public static final int STATE_VIDEO_CAPTURED = 32;

	//encoding constants used when requesting snapshot data
	public static final int ENCODING_IMG_UNKNOWN = -1;

	public static final int ENCODING_IMG_PNG = 0;

	public static final int ENCODING_IMG_JPEG = 2;

	public static final int ENCODING_IMG_PIXMAP = 4;

	public static final int ENCODING_IMG_GIF = 8;

	public static final int ENCODING_IMG_BMP = 16;

	public static final int ENCODING_IMG_YUV = 18;

	//video constants
	public static final int ENCODING_VIDEO_3GP = 32;

	public static final int ENCODING_VIDEO_MPEG1 = 64;

	/**
	 * @param reqEncoding The desired type of encoding data.
	 *
	 * @returns Zero if no problem, something else if there's a problem.
	 */
	public int setEncoding(int reqEncoding);

	/**
	 * @returns The kind of encoding this viewer is set to produce.
	 */
	public int getEncoding();

	/**
	 * Sets an initial image to be displayed before capturing a new image
	 */
	public void setInitialImage(Image startImage);

	/**
	 * @returns raw byte array of captured image data 
	 */
	public byte[] getCaptureData();

	/**
	 * gets a thumbnail of the captured data, if poossible
	 */
	public Image getThumbnail(int width, int height);

	/**
	 * @returns String A name for the captured media, if any.
	 */
	public String getMediaName();

	/**
	 * @returns String A type for the captured media, if any.
	 */
	public String getMediaType();

	/**
	 * @param viewState One of the STATE_VIDEO, STATE_PHOTO constants
	 */
	public void setViewState(int viewState);

	/**
	 *@return One of the STATE_FOO constants
	 */
	public int getViewState();

}